﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Web.Caching;

namespace ProjectBase.Core
{
    /// <summary>
    ///     Allows get and set data to the Cache object withe CacheDependency
    /// </summary>
    public interface ICacheStorage
    {
        /// <summary>
        ///     Gets or sets the cache item at the specified key.
        /// </summary>
        /// <param name = "key">A System.String object that represents the key for the cache item.</param>
        /// <returns>The specified cache item.</returns>
        object this[string key] { get; set; }

        /// <summary>
        ///     Inserts an object into the System.Web.Caching.Cache that has file or key
        ///     dependencies.
        /// </summary>
        /// <param name = "key">The cache key used to identify the item.</param>
        /// <param name = "value">The object to be inserted in the cache.</param>
        /// <param name = "dependencies">The file or cache key dependencies for the inserted object. When any dependency
        ///     changes, the object becomes invalid and is removed from the cache. If there
        ///     are no dependencies, this parameter contains null.</param>
        /// <exception cref = "System.ArgumentNullException">The key or value parameter is null.</exception>
        void Insert(string key, object value, CacheDependency dependencies);

        ///<summary>
        ///    Inserts an object into the System.Web.Caching.Cache with dependencies and
        ///    expiration policies.
        ///</summary>
        ///<param name = "key">The cache key used to reference the object.</param>
        ///<param name = "value">The object to be inserted in the cache.</param>
        ///<param name = "dependencies">
        ///    The file or cache key dependencies for the inserted object. When any dependency
        ///    changes, the object becomes invalid and is removed from the cache. If there
        ///    are no dependencies, this parameter contains null.
        ///</param>
        ///<param name = "absoluteExpiration">
        ///    The time at which the inserted object expires and is removed from the cache.
        ///    To avoid possible issues with local time such as changes from standard time
        ///    to daylight saving time, use System.DateTime.UtcNow rather than System.DateTime.Now
        ///    for this parameter value. If you are using absolute expiration, the slidingExpiration
        ///    parameter must be System.Web.Caching.Cache.NoSlidingExpiration.
        ///</param>
        ///<param name = "slidingExpiration">The interval between the time the inserted object is last accessed and the
        ///    time at which that object expires. If this value is the equivalent of 20
        ///    minutes, the object will expire and be removed from the cache 20 minutes
        ///    after it was last accessed. If you are using sliding expiration, the absoluteExpiration
        ///    parameter must be System.Web.Caching.Cache.NoAbsoluteExpiration.
        ///</param>
        ///<exception cref = "System.ArgumentNullException">The key or value parameter is null</exception>
        ///<exception cref = "System.ArgumentOutOfRangeException">You set the slidingExpiration parameter to less than TimeSpan.Zero or the
        ///    equivalent of more than one year.</exception>
        ///<exception cref = "System.ArgumentException">The absoluteExpiration and slidingExpiration parameters are both set for
        ///    the item you are trying to add to the Cache.</exception>
        void Insert(string key, object value, CacheDependency dependencies, DateTime absoluteExpiration,
            TimeSpan slidingExpiration);
        /// <summary>
        ///     Removes the cached object referenced by provided key
        /// </summary>
        /// <param name="key"></param>
        void Remove(string key);
    }
}